module: add tests for two cases of eager imports:#64197
Conversation
There was a problem hiding this comment.
Note that this is already tested in test262:
- https://github.com/tc39/test262/tree/main/test/language/import/import-defer/evaluation-top-level-await/import-defer-async-module
- https://github.com/tc39/test262/blob/main/test/language/import/import-defer/evaluation-sync/module-imported-defer-and-eager.js
I am not super familiar with the Node.js implementation of ESM, but test262 is run through V8's d8.
Whether or not it makes sense to have these two tests here probably depends on how much they are testing V8-internal code paths vs if there is any part of it that is implemented on the Node.js side.
The tests look correct :)
|
Oh, could you update the commit first line to mention that it's about import defer? |
|
This doesn't look very Node.js specific and should live in test262 instead? As long as the V8 side works alright I think it's unlikely that anything in particular in Node.js would make it not work. |
af6b72a to
87536da
Compare
I was thinking about it and as those 2 tests are really simple, I think it's worth having them in Node.js as well. They are not anymore engine-specific than the initial 2 smoke tests I added in Node. Also makes it really easy to run and - if needed - debug the code in Node directly. |
69a8b3b to
78d8282
Compare
- when the defer imported module contains top-level await - when the defer imported module is also eagerly imported Refs: https://github.com/tc39/proposal-defer-import-eval Signed-off-by: Maya Lekova <maya@igalia.com>
78d8282 to
b135b16
Compare
module: add tests for two cases of eager imports when using
import deferRefs: https://github.com/tc39/proposal-defer-import-eval
Signed-off-by: Maya Lekova maya@igalia.com